//
//  YZMainNavigationController.m
//  VET
//
//  Created by Lam BG on 2018/6/25.
//  Copyright © 2018年 YZ. All rights reserved.
//

#import "YZMainNavigationController.h"

@interface YZMainNavigationController ()

@end

@implementation YZMainNavigationController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
//    [self.navigationBar setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault];
    [self.navigationBar setShadowImage:[[UIImage alloc] init]];
}

- (void)dealloc {
    
    NSLog(@"--- %@ dealloc ---", NSStringFromClass([self class]));
}

// 重写方法 在 push 时，把 tabBar 隐藏
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated{
    if (self.viewControllers.count >= 1) {
        
        // 隐藏 tabBar
        viewController.hidesBottomBarWhenPushed = YES;
    }
    [super pushViewController:viewController animated:animated];
}

- (NSArray<UIViewController *> *)popToViewController:(UIViewController *)viewController animated:(BOOL)animated
{
    if(self.popBlock)
    {
        self.popBlock();
        self.popBlock = nil;
    }
    return [super popToViewController:viewController animated:animated];
}

- (UIViewController *)popViewControllerAnimated:(BOOL)animated
{
    if(self.popBlock)
    {
        self.popBlock();
        self.popBlock = nil;
    }
    return [super popViewControllerAnimated:animated];
}
@end
